3.4.54 \(\int \frac {\tan ^2(e+f x)}{(a+b \tan ^2(e+f x))^{5/2}} \, dx\) [354]

Optimal. Leaf size=128 \[ -\frac {\text {ArcTan}\left (\frac {\sqrt {a-b} \tan (e+f x)}{\sqrt {a+b \tan ^2(e+f x)}}\right )}{(a-b)^{5/2} f}+\frac {\tan (e+f x)}{3 (a-b) f \left (a+b \tan ^2(e+f x)\right )^{3/2}}+\frac {(2 a+b) \tan (e+f x)}{3 a (a-b)^2 f \sqrt {a+b \tan ^2(e+f x)}} \]

[Out]

-arctan((a-b)^(1/2)*tan(f*x+e)/(a+b*tan(f*x+e)^2)^(1/2))/(a-b)^(5/2)/f+1/3*(2*a+b)*tan(f*x+e)/a/(a-b)^2/f/(a+b
*tan(f*x+e)^2)^(1/2)+1/3*tan(f*x+e)/(a-b)/f/(a+b*tan(f*x+e)^2)^(3/2)

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 128, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {3751, 482, 541, 12, 385, 209} \begin {gather*} -\frac {\text {ArcTan}\left (\frac {\sqrt {a-b} \tan (e+f x)}{\sqrt {a+b \tan ^2(e+f x)}}\right )}{f (a-b)^{5/2}}+\frac {(2 a+b) \tan (e+f x)}{3 a f (a-b)^2 \sqrt {a+b \tan ^2(e+f x)}}+\frac {\tan (e+f x)}{3 f (a-b) \left (a+b \tan ^2(e+f x)\right )^{3/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^2/(a + b*Tan[e + f*x]^2)^(5/2),x]

[Out]

-(ArcTan[(Sqrt[a - b]*Tan[e + f*x])/Sqrt[a + b*Tan[e + f*x]^2]]/((a - b)^(5/2)*f)) + Tan[e + f*x]/(3*(a - b)*f
*(a + b*Tan[e + f*x]^2)^(3/2)) + ((2*a + b)*Tan[e + f*x])/(3*a*(a - b)^2*f*Sqrt[a + b*Tan[e + f*x]^2])

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Subst[Int[1/(c - (b*c - a*d)*x^n), x]
, x, x/(a + b*x^n)^(1/n)] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && EqQ[n*p + 1, 0] && IntegerQ[n]

Rule 482

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[e^(n - 1
)*(e*x)^(m - n + 1)*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q + 1)/(n*(b*c - a*d)*(p + 1))), x] - Dist[e^n/(n*(b*c -
 a*d)*(p + 1)), Int[(e*x)^(m - n)*(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[c*(m - n + 1) + d*(m + n*(p + q + 1)
+ 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[p, -1] && GeQ[n
, m - n + 1] && GtQ[m - n + 1, 0] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 541

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_.)*((e_) + (f_.)*(x_)^(n_)), x_Symbol] :> Simp[(
-(b*e - a*f))*x*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q + 1)/(a*n*(b*c - a*d)*(p + 1))), x] + Dist[1/(a*n*(b*c - a
*d)*(p + 1)), Int[(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[c*(b*e - a*f) + e*n*(b*c - a*d)*(p + 1) + d*(b*e - a*
f)*(n*(p + q + 2) + 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, f, n, q}, x] && LtQ[p, -1]

Rule 3751

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff/f), Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2
 + ff^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps

\begin {align*} \int \frac {\tan ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^{5/2}} \, dx &=\frac {\text {Subst}\left (\int \frac {x^2}{\left (1+x^2\right ) \left (a+b x^2\right )^{5/2}} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\tan (e+f x)}{3 (a-b) f \left (a+b \tan ^2(e+f x)\right )^{3/2}}-\frac {\text {Subst}\left (\int \frac {1-2 x^2}{\left (1+x^2\right ) \left (a+b x^2\right )^{3/2}} \, dx,x,\tan (e+f x)\right )}{3 (a-b) f}\\ &=\frac {\tan (e+f x)}{3 (a-b) f \left (a+b \tan ^2(e+f x)\right )^{3/2}}+\frac {(2 a+b) \tan (e+f x)}{3 a (a-b)^2 f \sqrt {a+b \tan ^2(e+f x)}}-\frac {\text {Subst}\left (\int \frac {3 a}{\left (1+x^2\right ) \sqrt {a+b x^2}} \, dx,x,\tan (e+f x)\right )}{3 a (a-b)^2 f}\\ &=\frac {\tan (e+f x)}{3 (a-b) f \left (a+b \tan ^2(e+f x)\right )^{3/2}}+\frac {(2 a+b) \tan (e+f x)}{3 a (a-b)^2 f \sqrt {a+b \tan ^2(e+f x)}}-\frac {\text {Subst}\left (\int \frac {1}{\left (1+x^2\right ) \sqrt {a+b x^2}} \, dx,x,\tan (e+f x)\right )}{(a-b)^2 f}\\ &=\frac {\tan (e+f x)}{3 (a-b) f \left (a+b \tan ^2(e+f x)\right )^{3/2}}+\frac {(2 a+b) \tan (e+f x)}{3 a (a-b)^2 f \sqrt {a+b \tan ^2(e+f x)}}-\frac {\text {Subst}\left (\int \frac {1}{1-(-a+b) x^2} \, dx,x,\frac {\tan (e+f x)}{\sqrt {a+b \tan ^2(e+f x)}}\right )}{(a-b)^2 f}\\ &=-\frac {\tan ^{-1}\left (\frac {\sqrt {a-b} \tan (e+f x)}{\sqrt {a+b \tan ^2(e+f x)}}\right )}{(a-b)^{5/2} f}+\frac {\tan (e+f x)}{3 (a-b) f \left (a+b \tan ^2(e+f x)\right )^{3/2}}+\frac {(2 a+b) \tan (e+f x)}{3 a (a-b)^2 f \sqrt {a+b \tan ^2(e+f x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
time = 7.13, size = 365, normalized size = 2.85 \begin {gather*} \frac {\cos ^4(e+f x) \cot (e+f x) \left (12 (a-b)^3 \, _2F_1\left (2,2;\frac {9}{2};\frac {(a-b) \sin ^2(e+f x)}{a}\right ) \tan ^6(e+f x) \left (a+b \tan ^2(e+f x)\right ) \sqrt {\frac {\cos ^2(e+f x) \sin ^2(e+f x) \left (a^2-b^2 \tan ^2(e+f x)+a b \left (-1+\tan ^2(e+f x)\right )\right )}{a^2}}+35 a \sec ^2(e+f x) \left (5 a+2 b \tan ^2(e+f x)\right ) \left (3 \text {ArcSin}\left (\sqrt {\frac {(a-b) \sin ^2(e+f x)}{a}}\right ) \left (a+b \tan ^2(e+f x)\right )^2+a \sec ^2(e+f x) \left (-4 b \tan ^2(e+f x)+a \left (-3+\tan ^2(e+f x)\right )\right ) \sqrt {\frac {\cos ^2(e+f x) \sin ^2(e+f x) \left (a^2-b^2 \tan ^2(e+f x)+a b \left (-1+\tan ^2(e+f x)\right )\right )}{a^2}}\right )\right )}{315 a^4 (a-b)^2 f \sqrt {a+b \tan ^2(e+f x)} \sqrt {\frac {(a-b) \cos ^2(e+f x) \sin ^2(e+f x) \left (a+b \tan ^2(e+f x)\right )}{a^2}} \left (1+\frac {b \tan ^2(e+f x)}{a}\right )} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[Tan[e + f*x]^2/(a + b*Tan[e + f*x]^2)^(5/2),x]

[Out]

(Cos[e + f*x]^4*Cot[e + f*x]*(12*(a - b)^3*Hypergeometric2F1[2, 2, 9/2, ((a - b)*Sin[e + f*x]^2)/a]*Tan[e + f*
x]^6*(a + b*Tan[e + f*x]^2)*Sqrt[(Cos[e + f*x]^2*Sin[e + f*x]^2*(a^2 - b^2*Tan[e + f*x]^2 + a*b*(-1 + Tan[e +
f*x]^2)))/a^2] + 35*a*Sec[e + f*x]^2*(5*a + 2*b*Tan[e + f*x]^2)*(3*ArcSin[Sqrt[((a - b)*Sin[e + f*x]^2)/a]]*(a
 + b*Tan[e + f*x]^2)^2 + a*Sec[e + f*x]^2*(-4*b*Tan[e + f*x]^2 + a*(-3 + Tan[e + f*x]^2))*Sqrt[(Cos[e + f*x]^2
*Sin[e + f*x]^2*(a^2 - b^2*Tan[e + f*x]^2 + a*b*(-1 + Tan[e + f*x]^2)))/a^2])))/(315*a^4*(a - b)^2*f*Sqrt[a +
b*Tan[e + f*x]^2]*Sqrt[((a - b)*Cos[e + f*x]^2*Sin[e + f*x]^2*(a + b*Tan[e + f*x]^2))/a^2]*(1 + (b*Tan[e + f*x
]^2)/a))

________________________________________________________________________________________

Maple [A]
time = 0.09, size = 212, normalized size = 1.66

method result size
derivativedivides \(\frac {\frac {\tan \left (f x +e \right )}{3 a \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )^{\frac {3}{2}}}+\frac {2 \tan \left (f x +e \right )}{3 a^{2} \sqrt {a +b \left (\tan ^{2}\left (f x +e \right )\right )}}+\frac {b \left (\frac {\tan \left (f x +e \right )}{3 a \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )^{\frac {3}{2}}}+\frac {2 \tan \left (f x +e \right )}{3 a^{2} \sqrt {a +b \left (\tan ^{2}\left (f x +e \right )\right )}}\right )}{a -b}-\frac {\sqrt {b^{4} \left (a -b \right )}\, \arctan \left (\frac {b^{2} \left (a -b \right ) \tan \left (f x +e \right )}{\sqrt {b^{4} \left (a -b \right )}\, \sqrt {a +b \left (\tan ^{2}\left (f x +e \right )\right )}}\right )}{\left (a -b \right )^{3} b^{2}}+\frac {b \tan \left (f x +e \right )}{\left (a -b \right )^{2} a \sqrt {a +b \left (\tan ^{2}\left (f x +e \right )\right )}}}{f}\) \(212\)
default \(\frac {\frac {\tan \left (f x +e \right )}{3 a \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )^{\frac {3}{2}}}+\frac {2 \tan \left (f x +e \right )}{3 a^{2} \sqrt {a +b \left (\tan ^{2}\left (f x +e \right )\right )}}+\frac {b \left (\frac {\tan \left (f x +e \right )}{3 a \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )^{\frac {3}{2}}}+\frac {2 \tan \left (f x +e \right )}{3 a^{2} \sqrt {a +b \left (\tan ^{2}\left (f x +e \right )\right )}}\right )}{a -b}-\frac {\sqrt {b^{4} \left (a -b \right )}\, \arctan \left (\frac {b^{2} \left (a -b \right ) \tan \left (f x +e \right )}{\sqrt {b^{4} \left (a -b \right )}\, \sqrt {a +b \left (\tan ^{2}\left (f x +e \right )\right )}}\right )}{\left (a -b \right )^{3} b^{2}}+\frac {b \tan \left (f x +e \right )}{\left (a -b \right )^{2} a \sqrt {a +b \left (\tan ^{2}\left (f x +e \right )\right )}}}{f}\) \(212\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^2/(a+b*tan(f*x+e)^2)^(5/2),x,method=_RETURNVERBOSE)

[Out]

1/f*(1/3*tan(f*x+e)/a/(a+b*tan(f*x+e)^2)^(3/2)+2/3/a^2*tan(f*x+e)/(a+b*tan(f*x+e)^2)^(1/2)+1/(a-b)*b*(1/3*tan(
f*x+e)/a/(a+b*tan(f*x+e)^2)^(3/2)+2/3/a^2*tan(f*x+e)/(a+b*tan(f*x+e)^2)^(1/2))-1/(a-b)^3*(b^4*(a-b))^(1/2)/b^2
*arctan(b^2*(a-b)/(b^4*(a-b))^(1/2)/(a+b*tan(f*x+e)^2)^(1/2)*tan(f*x+e))+1/(a-b)^2*b*tan(f*x+e)/a/(a+b*tan(f*x
+e)^2)^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^2/(a+b*tan(f*x+e)^2)^(5/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(b-a>0)', see `assume?` for mor
e details)Is

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 258 vs. \(2 (120) = 240\).
time = 2.77, size = 549, normalized size = 4.29 \begin {gather*} \left [-\frac {3 \, {\left (a b^{2} \tan \left (f x + e\right )^{4} + 2 \, a^{2} b \tan \left (f x + e\right )^{2} + a^{3}\right )} \sqrt {-a + b} \log \left (-\frac {{\left (a - 2 \, b\right )} \tan \left (f x + e\right )^{2} + 2 \, \sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {-a + b} \tan \left (f x + e\right ) - a}{\tan \left (f x + e\right )^{2} + 1}\right ) - 2 \, {\left ({\left (2 \, a^{2} b - a b^{2} - b^{3}\right )} \tan \left (f x + e\right )^{3} + 3 \, {\left (a^{3} - a^{2} b\right )} \tan \left (f x + e\right )\right )} \sqrt {b \tan \left (f x + e\right )^{2} + a}}{6 \, {\left ({\left (a^{4} b^{2} - 3 \, a^{3} b^{3} + 3 \, a^{2} b^{4} - a b^{5}\right )} f \tan \left (f x + e\right )^{4} + 2 \, {\left (a^{5} b - 3 \, a^{4} b^{2} + 3 \, a^{3} b^{3} - a^{2} b^{4}\right )} f \tan \left (f x + e\right )^{2} + {\left (a^{6} - 3 \, a^{5} b + 3 \, a^{4} b^{2} - a^{3} b^{3}\right )} f\right )}}, -\frac {3 \, {\left (a b^{2} \tan \left (f x + e\right )^{4} + 2 \, a^{2} b \tan \left (f x + e\right )^{2} + a^{3}\right )} \sqrt {a - b} \arctan \left (-\frac {\sqrt {b \tan \left (f x + e\right )^{2} + a}}{\sqrt {a - b} \tan \left (f x + e\right )}\right ) - {\left ({\left (2 \, a^{2} b - a b^{2} - b^{3}\right )} \tan \left (f x + e\right )^{3} + 3 \, {\left (a^{3} - a^{2} b\right )} \tan \left (f x + e\right )\right )} \sqrt {b \tan \left (f x + e\right )^{2} + a}}{3 \, {\left ({\left (a^{4} b^{2} - 3 \, a^{3} b^{3} + 3 \, a^{2} b^{4} - a b^{5}\right )} f \tan \left (f x + e\right )^{4} + 2 \, {\left (a^{5} b - 3 \, a^{4} b^{2} + 3 \, a^{3} b^{3} - a^{2} b^{4}\right )} f \tan \left (f x + e\right )^{2} + {\left (a^{6} - 3 \, a^{5} b + 3 \, a^{4} b^{2} - a^{3} b^{3}\right )} f\right )}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^2/(a+b*tan(f*x+e)^2)^(5/2),x, algorithm="fricas")

[Out]

[-1/6*(3*(a*b^2*tan(f*x + e)^4 + 2*a^2*b*tan(f*x + e)^2 + a^3)*sqrt(-a + b)*log(-((a - 2*b)*tan(f*x + e)^2 + 2
*sqrt(b*tan(f*x + e)^2 + a)*sqrt(-a + b)*tan(f*x + e) - a)/(tan(f*x + e)^2 + 1)) - 2*((2*a^2*b - a*b^2 - b^3)*
tan(f*x + e)^3 + 3*(a^3 - a^2*b)*tan(f*x + e))*sqrt(b*tan(f*x + e)^2 + a))/((a^4*b^2 - 3*a^3*b^3 + 3*a^2*b^4 -
 a*b^5)*f*tan(f*x + e)^4 + 2*(a^5*b - 3*a^4*b^2 + 3*a^3*b^3 - a^2*b^4)*f*tan(f*x + e)^2 + (a^6 - 3*a^5*b + 3*a
^4*b^2 - a^3*b^3)*f), -1/3*(3*(a*b^2*tan(f*x + e)^4 + 2*a^2*b*tan(f*x + e)^2 + a^3)*sqrt(a - b)*arctan(-sqrt(b
*tan(f*x + e)^2 + a)/(sqrt(a - b)*tan(f*x + e))) - ((2*a^2*b - a*b^2 - b^3)*tan(f*x + e)^3 + 3*(a^3 - a^2*b)*t
an(f*x + e))*sqrt(b*tan(f*x + e)^2 + a))/((a^4*b^2 - 3*a^3*b^3 + 3*a^2*b^4 - a*b^5)*f*tan(f*x + e)^4 + 2*(a^5*
b - 3*a^4*b^2 + 3*a^3*b^3 - a^2*b^4)*f*tan(f*x + e)^2 + (a^6 - 3*a^5*b + 3*a^4*b^2 - a^3*b^3)*f)]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tan ^{2}{\left (e + f x \right )}}{\left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{\frac {5}{2}}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**2/(a+b*tan(f*x+e)**2)**(5/2),x)

[Out]

Integral(tan(e + f*x)**2/(a + b*tan(e + f*x)**2)**(5/2), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^2/(a+b*tan(f*x+e)^2)^(5/2),x, algorithm="giac")

[Out]

integrate(tan(f*x + e)^2/(b*tan(f*x + e)^2 + a)^(5/2), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\mathrm {tan}\left (e+f\,x\right )}^2}{{\left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a\right )}^{5/2}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(e + f*x)^2/(a + b*tan(e + f*x)^2)^(5/2),x)

[Out]

int(tan(e + f*x)^2/(a + b*tan(e + f*x)^2)^(5/2), x)

________________________________________________________________________________________